// pages/onlineNum/onlineNum.js


const app = getApp()
import * as echarts from '../../ec-canvas/echarts'
function initChart(canvas, width, height, dpr) {
  const chart = echarts.init(canvas, null, {
    width: width,
    height: height,
    devicePixelRatio: dpr // 像素比
  });
  canvas.setChart(chart);

  var option = {
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: [14, 15, 14, 10, 21, 22, 21],
        type: 'line'
      }
    ]
  };
  chart.setOption(option);
  return chart;
}

Page({
  data: {
    ec: {
      onInit: initChart
    }
  },
  onLoad(){
    // wx.showToast({
    //   title: '123',
    // })
  },
  onShow(){
    wx.showToast({
      title: '456',
    })
  }
});


